import 'package:flutter/material.dart';
import 'model.dart';

class FilmItem extends StatelessWidget {
  final Film film;
  static final double titleFontSize = 16.0;
  static final double subTitleFontSize = 14.0;
  static final Color titleColor = Colors.black.withAlpha(220);
  static final Color subTitleColor = Colors.black87;

  FilmItem({this.film});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        ListTile(
          title: Text(
            this.film.title,
            style: TextStyle(
              color: titleColor,
              fontWeight: FontWeight.bold,
              fontSize: titleFontSize,
            ),
          ),
          subtitle: Row(
            children: <Widget>[
              Icon(
                Icons.movie,
                color: subTitleColor,
                size: subTitleFontSize,
              ),
              Container(
                margin: const EdgeInsets.only(left: 4.0),
                child: Text(
                  film?.director,
                  style: TextStyle(
                    color: subTitleColor,
                  ),
                ),
              ),
            ],
          ),
        ),
        Divider(
          height: 1.0,
        ),
      ],
    );
  }
}
